import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { Ab02newVO, Ab02newForm, Ab02newQuery } from '@/api/yuanshidian/ab02new/types';

/**
 * 查询新在职人员信息列表
 * @param query
 * @returns {*}
 */

export const listAb02new = (query?: Ab02newQuery): AxiosPromise<Ab02newVO[]> => {
  return request({
    url: '/yuanshidian/ab02new/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询新在职人员信息详细
 * @param ID
 */
export const getAb02new = (ID: string | number): AxiosPromise<Ab02newVO> => {
  return request({
    url: '/yuanshidian/ab02new/' + ID,
    method: 'get'
  });
};

/**
 * 新增新在职人员信息
 * @param data
 */
export const addAb02new = (data: Ab02newForm) => {
  return request({
    url: '/yuanshidian/ab02new',
    method: 'post',
    data: data
  });
};

/**
 * 修改新在职人员信息
 * @param data
 */
export const updateAb02new = (data: Ab02newForm) => {
  return request({
    url: '/yuanshidian/ab02new',
    method: 'put',
    data: data
  });
};

/**
 * 删除新在职人员信息
 * @param ID
 */
export const delAb02new = (ID: string | number | Array<string | number>) => {
  return request({
    url: '/yuanshidian/ab02new/' + ID,
    method: 'delete'
  });
};
